package com.dk.logc.controller;

import com.baomidou.mybatisplus.extension.toolkit.SqlRunner;
import com.dk.logc.business.CountRoleBusiness;
import com.dk.logc.domain.CountRoleSum;
import com.dk.logc.mapper.CountRoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author 林道敬
 * @Date 2024-01-05
 * @Description
 **/
@RestController
@RequestMapping("/count")
public class ControllerController {

    @Autowired
    CountRoleMapper countRoleMapper;
    @Autowired
    CountRoleBusiness countRoleBusiness;

    @RequestMapping("role")
    public CountRoleSum countRoleMapper(String channelId, Integer serverNo){
        return countRoleMapper.queryAllByNum(channelId,serverNo);
    }
    @RequestMapping("test")
    public void test(){
        String dateStr = "login_day1";
        System.out.println(SqlRunner.db()
//                .selectOne("select * from count_role where id=1807230"));

                .update("update count_role set "+dateStr+"=("+dateStr +"+1) WHERE id=1807230"));
    }


}
